package com.observer.observer;

//订阅服务的第2网站
public class WebSit2BaiduObserver implements Observer{
    private float temperature;
    private float pressure;
    private float humidity;

    //留给服务端调用，服务端调用这个方法推送天气信息
    @Override
    public void update(float temprature, float pressure, float humidity) {
        this.temperature = temprature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    public void display(){
        System.out.println("======= 百度网站收到更新数据 ======= ");
        System.out.println("******today temperature : "+ temperature +"*******");
        System.out.println("******today pressure : "+ pressure +"*******");
        System.out.println("******today humidity : "+ humidity +"*******");
    }
}
